#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("fruit4.in","w",stdout);
	int n=2e5,sq=2;
	printf("%d\n",n);
	for(int i=1;i<=n;i+=sq+1){
		for(int j=i;j<=min(i+sq-1,n);j++)
			printf("0 ");
		printf("1 ");
	}
}
